<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2020/10/13
  Time: 11:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%--
    taglib:标签引入第三标签库,指令可以放在任意地方，一般放在最 上面

    prefix: 前缀，一般自己指定。但是有命名规范  core:c    ; functions  fn
--%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>


<html>
<head>
    <title>Title</title>
</head>
<body>
<p>${fn:length("hello java,hello World")}</p>
<p>${fn:toUpperCase("Hello java,hello World")}</p>

<%
    String[] strs = {"a", "b", "c"};
    List list = new ArrayList();
    list.add("a");

    pageContext.setAttribute("arr", strs);
    pageContext.setAttribute("list", list);
%>
${fn:length(arr) }
<br/>
<!--3-->
${fn:length(list) }
<br/>
<!--1-->
${fn:toLowerCase("Hello") }
<br/>
<!-- hello -->
${fn:toUpperCase("Hello")}
<br/>
<!-- HELLO -->
${fn:contains("abc", "a")}
<br/>
<!-- true -->
${fn:containsIgnoreCase("abc", "Ab")}
<br/>
<!-- true -->
${fn:contains(arr, "a")}
<br/>
<!-- true -->
${fn:containsIgnoreCase(list, "A")}
<br/>
<!-- true -->
${fn:endsWith("Hello.java", ".java")}
<br/>
<!-- true -->
${fn:startsWith("Hello.java", "Hell")}
<br/>
<!-- true -->
${fn:indexOf("Hello-World", "-")}
<br/>
<!-- 5 -->
${fn:join(arr, "-")}
<br/>
<!-- a-b-c -->
${fn:replace("Hello-World", "-", "+")}
<br/>
<!-- Hello+World -->
${fn:join(fn:split("a;b;c;", ";"), "-")}
<br/>
<!-- a-b-c -->

${fn:substring("0123456789", 6, 9)}
<br/>
<!-- 678 -->
${fn:substring("0123456789", 5, -1)}
<br/>
<!-- 56789 -->
${fn:substringAfter("Hello-World", "-")}
<br/>
<!-- World -->
${fn:substringBefore("Hello-World", "-")}
<br/>
<!-- Hello -->
${fn:trim("     a b c     ")}
<br/>
<!-- a b c -->
${fn:escapeXml("<html></html>")}
<br/>
<!-- <html></html> -->

</body>
</html>
